Skip to content

Conversation

Steelskin
Copy link
Contributor

This is the proper installation scheme for Swift libraries and prevents having to manually copy them in build.ps1.

This is the proper installation scheme for Swift libraries and prevents
having to manually copy them in `build.ps1`.
@Steelskin
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are updating this, we should be using the new tooling that we have been adding into the runtimes build. There is already a pending change of mine that needs to be refreshed for this.

@Steelskin Steelskin requested a review from compnerd August 4, 2025 18:57
@Steelskin
Copy link
Contributor Author

If we are updating this, we should be using the new tooling that we have been adding into the runtimes build. There is already a pending change of mine that needs to be refreshed for this.

I changed this to get the arch value from the compiler. Is this what you had in mind?

This also refactors the code so we only do a single call to the Swift
compiler to gather the target info JSON.
@Steelskin Steelskin requested a review from compnerd August 5, 2025 18:38
@Steelskin
Copy link
Contributor Author

@swift-ci please smoke test

@Steelskin
Copy link
Contributor Author

@swift-ci please test

@compnerd
Copy link
Member

compnerd commented Aug 6, 2025

@swift-ci please test Windows platform

@compnerd
Copy link
Member

compnerd commented Aug 6, 2025

@swift-ci please test Linux platform

@Steelskin
Copy link
Contributor Author

@swift-ci please test windows platform

@Steelskin
Copy link
Contributor Author

@swift-ci please test linux platform

@Steelskin Steelskin requested review from compnerd and etcwilde August 6, 2025 16:59
@Steelskin
Copy link
Contributor Author

@swift-ci please test Windows platform

@Steelskin
Copy link
Contributor Author

@swift-ci please test linux platform

@Steelskin
Copy link
Contributor Author

@swift-ci please test Windows platform

@Steelskin
Copy link
Contributor Author

@swift-ci please test Linux platform

@Steelskin
Copy link
Contributor Author

@swift-ci please test

@compnerd
Copy link
Member

I think that we should do a cross-repo test and ensure that we can build the windows toolchain, Linux toolchain, and that they both function after this change.

@Steelskin
Copy link
Contributor Author

I think that we should do a cross-repo test and ensure that we can build the windows toolchain, Linux toolchain, and that they both function after this change.

I started a test build with the changes here: swiftlang/swift#83666

@Steelskin
Copy link
Contributor Author

I tested the resulting installer on Windows and our internal projects built successfully with it. Can we land this or is there anything else I should test here?

@compnerd
Copy link
Member

Yes, please also validate that the Linux toolchain still works properly.

@Steelskin
Copy link
Contributor Author

Steelskin commented Aug 20, 2025

Yes, please also validate that the Linux toolchain still works properly.

Thank you for the pointers for installing the built artifact. Here is a test project I used:

$ ~/usr/bin/swift build
Fetching https://github.com/apple/swift-collections.git
Fetched https://github.com/apple/swift-collections.git from cache (1.10s)
Computing version for https://github.com/apple/swift-collections.git
Computed https://github.com/apple/swift-collections.git at 1.0.6 (1.33s)
Creating working copy for https://github.com/apple/swift-collections.git
Working copy of https://github.com/apple/swift-collections.git resolved at 1.0.6
Building for debugging...
/home/steelo/src/cassowary/Sources/Cassowary/Expression.swift:5:1: warning: using '@_implementationOnly' without enabling library evolution for 'Cassowary' may lead to instability during execution [#ImplementationOnlyDeprecated]
 3 |
 4 | @_implementationOnly
 5 | import OrderedCollections
   | `- warning: using '@_implementationOnly' without enabling library evolution for 'Cassowary' may lead to instability during execution [#ImplementationOnlyDeprecated]
 6 |
 7 | /// An expression is a linear combination of terms and a constant.

/home/steelo/src/cassowary/Sources/Cassowary/Row.swift:5:1: warning: using '@_implementationOnly' without enabling library evolution for 'Cassowary' may lead to instability during execution [#ImplementationOnlyDeprecated]
  3 |
  4 | @_implementationOnly
  5 | import OrderedCollections
    | `- warning: using '@_implementationOnly' without enabling library evolution for 'Cassowary' may lead to instability during execution [#ImplementationOnlyDeprecated]
  6 |
  7 | internal final class Row {

[#ImplementationOnlyDeprecated]: <https://docs.swift.org/compiler/documentation/diagnostics/implementation-only-deprecated>
/home/steelo/src/cassowary/Sources/Cassowary/Row.swift:5:1: warning: using '@_implementationOnly' without enabling library evolution for 'Cassowary' may lead to instability during execution [#ImplementationOnlyDeprecated]
  3 |
  4 | @_implementationOnly
  5 | import OrderedCollections
    | `- warning: using '@_implementationOnly' without enabling library evolution for 'Cassowary' may lead to instability during execution [#ImplementationOnlyDeprecated]
  6 |
  7 | internal final class Row {

[#ImplementationOnlyDeprecated]: <https://docs.swift.org/compiler/documentation/diagnostics/implementation-only-deprecated>
/home/steelo/src/cassowary/Sources/Cassowary/Expression.swift:5:1: warning: using '@_implementationOnly' without enabling library evolution for 'Cassowary' may lead to instability during execution [#ImplementationOnlyDeprecated]
 3 |
 4 | @_implementationOnly
 5 | import OrderedCollections
   | `- warning: using '@_implementationOnly' without enabling library evolution for 'Cassowary' may lead to instability during execution [#ImplementationOnlyDeprecated]
 6 |
 7 | /// An expression is a linear combination of terms and a constant.

[#ImplementationOnlyDeprecated]: <https://docs.swift.org/compiler/documentation/diagnostics/implementation-only-deprecated>
[69/69] Compiling Cassowary Expression.swift
Build complete! (5.50s)

$ ~/usr/bin/swift test
[1/1] Planning build
Building for debugging...
/home/steelo/src/cassowary/Tests/CassowaryTests/CassowaryTests.swift:231:16: warning: 'add(constraint:_:)' is deprecated: renamed add(constraint:strength:) [#DeprecatedDeclaration]
229 |
230 |     try solver.add(variable: c, strength: .strong)
231 |     try solver.add(constraint: a >= 0, .strong)
    |                `- warning: 'add(constraint:_:)' is deprecated: renamed add(constraint:strength:) [#DeprecatedDeclaration]
232 |     try solver.add(constraint: b >= a, .strong)
233 |     try solver.add(constraint: b - a == c, .required)

/home/steelo/src/cassowary/Tests/CassowaryTests/CassowaryTests.swift:232:16: warning: 'add(constraint:_:)' is deprecated: renamed add(constraint:strength:) [#DeprecatedDeclaration]
230 |     try solver.add(variable: c, strength: .strong)
231 |     try solver.add(constraint: a >= 0, .strong)
232 |     try solver.add(constraint: b >= a, .strong)
    |                `- warning: 'add(constraint:_:)' is deprecated: renamed add(constraint:strength:) [#DeprecatedDeclaration]
233 |     try solver.add(constraint: b - a == c, .required)
234 |     try solver.suggest(value: 100, for: c)

/home/steelo/src/cassowary/Tests/CassowaryTests/CassowaryTests.swift:233:16: warning: 'add(constraint:_:)' is deprecated: renamed add(constraint:strength:) [#DeprecatedDeclaration]
231 |     try solver.add(constraint: a >= 0, .strong)
232 |     try solver.add(constraint: b >= a, .strong)
233 |     try solver.add(constraint: b - a == c, .required)
    |                `- warning: 'add(constraint:_:)' is deprecated: renamed add(constraint:strength:) [#DeprecatedDeclaration]
234 |     try solver.suggest(value: 100, for: c)
235 |

[#DeprecatedDeclaration]: <https://docs.swift.org/compiler/documentation/diagnostics/deprecated-declaration>
[23/23] Linking cassowaryPackageTests.xctest
Build complete! (4.67s)
Test Suite 'All tests' started at 2025-08-20 09:41:19.437
Test Suite 'debug.xctest' started at 2025-08-20 09:41:19.450
Test Suite 'CassowaryTests' started at 2025-08-20 09:41:19.450
Test Case 'CassowaryTests.testComplex1' started at 2025-08-20 09:41:19.450
Test Case 'CassowaryTests.testComplex1' passed (0.001 seconds)
Test Case 'CassowaryTests.testComplex2' started at 2025-08-20 09:41:19.451
Test Case 'CassowaryTests.testComplex2' passed (0.0 seconds)
Test Case 'CassowaryTests.testHandlingInfeasibleConstraints' started at 2025-08-20 09:41:19.451
Test Case 'CassowaryTests.testHandlingInfeasibleConstraints' passed (0.0 seconds)
Test Case 'CassowaryTests.testMultiTermExpressionOrder' started at 2025-08-20 09:41:19.452
Test Case 'CassowaryTests.testMultiTermExpressionOrder' passed (0.0 seconds)
Test Case 'CassowaryTests.testSimple1' started at 2025-08-20 09:41:19.452
Test Case 'CassowaryTests.testSimple1' passed (0.0 seconds)
Test Case 'CassowaryTests.testSimple2' started at 2025-08-20 09:41:19.452
Test Case 'CassowaryTests.testSimple2' passed (0.0 seconds)
Test Case 'CassowaryTests.testSimple3' started at 2025-08-20 09:41:19.452
Test Case 'CassowaryTests.testSimple3' passed (0.0 seconds)
Test Case 'CassowaryTests.testUnderConstrainedSystem' started at 2025-08-20 09:41:19.453
Test Case 'CassowaryTests.testUnderConstrainedSystem' passed (0.106 seconds)
Test Case 'CassowaryTests.testWithStrength' started at 2025-08-20 09:41:19.559
Test Case 'CassowaryTests.testWithStrength' passed (0.002 seconds)
Test Case 'CassowaryTests.testWithStrength2' started at 2025-08-20 09:41:19.561
Test Case 'CassowaryTests.testWithStrength2' passed (0.002 seconds)
Test Suite 'CassowaryTests' passed at 2025-08-20 09:41:19.562
         Executed 10 tests, with 0 failures (0 unexpected) in 0.113 (0.113) seconds
Test Suite 'debug.xctest' passed at 2025-08-20 09:41:19.562
         Executed 10 tests, with 0 failures (0 unexpected) in 0.113 (0.113) seconds
Test Suite 'All tests' passed at 2025-08-20 09:41:19.563
         Executed 10 tests, with 0 failures (0 unexpected) in 0.113 (0.113) seconds
◇ Test run started.
↳ Testing Library Version: 6.3-dev (a68a681c8adcd35)
↳ Target Platform: x86_64-unknown-linux-gnu
✔ Test run with 0 tests in 0 suites passed after 0.001 seconds.

@compnerd compnerd merged commit a6f0512 into swiftlang:main Aug 20, 2025
2 checks passed
@Steelskin Steelskin deleted the fabrice/package-swift-libs-arch-folder branch August 20, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants